package com.example.framework2002a.room;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;

import com.blankj.utilcode.util.Utils;

@Database(entities = {UserBean.class},version = 1,exportSchema = false)
public abstract class DataBD extends RoomDatabase {

    public abstract UserDao userDao();

    public static DataBD dataBD;

    public static DataBD getDataBD(){
        if (dataBD == null){
            dataBD = Room
                    .databaseBuilder(Utils.getApp(),DataBD.class,"db")
                    .allowMainThreadQueries()
                    .build();
        }
        return dataBD;
    }

}
